(function ($) {
    'use strict';
    $(function () {


        Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element

            // The configuration we've talked about above
            autoProcessQueue: false,
            uploadMultiple: true,
            parallelUploads: 100,
            maxFiles: 8,
            url: contextPath+'/zhu/shelves',
            addRemoveLinks:true,
            acceptedFiles:".jpg,.png,.jpeg,.gif",

            dictCancelUploadConfirmation:'你确定要取消上传吗？',
            dictMaxFilesExceeded: "您一次最多只能上传15个文件",
            maxfilesreached:"系统限制只能上传15个文件，你不能上传超过15个文件",
            dictFileTooBig:"文件过大,上传文件最大支持:100MB.",
            dictInvalidFileType:"文件类型只能是*.jpg,*.png,*.jpeg,*.gif",




            init: function () {
                var myDropzone = this;


                this.element.querySelector("button[type=submit]").addEventListener("click", function (e) {





                    if (myDropzone.getQueuedFiles().length == 0) {

                        e.stopPropagation();
                        myDropzone.processQueue();

                    }else{
                        e.preventDefault();
                        e.stopPropagation();
                        myDropzone.processQueue();
                    }
                });


                this.on("successmultiple", function (files, response) {





               });
                this.on("errormultiple", function (files, response) {

                });
            }

        }
    });

})(jQuery);
